package io.gitee.xyuesheng.day08;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class TestOOM {
    private static List<String> strings = new ArrayList<>();

    /**
     * OOM:OutOfMemoryErroy内存溢出
     *
     * @param args
     */
    public static void main(String[] args) {
        while (true) {
            strings.add(new String("abcdefghij"));
        }
    }

    @Test
    public void test() {
        // List list = new ArrayList<>();

        // ArrayList arrayList = (ArrayList) list;

        // LinkedList linkedList = (LinkedList) list;

        // int[] array = new int[1];

        // array[2] = 1;

        String str = "abc";
        System.out.println(str.charAt(3));
    }

}
